%Generate .mat files from data in excel spreadsheets


%data_wide.xls contains informational variables for factor analysis
%those variables are constructed in STATA by the "Data prep 3.do"
%file and then copied and pasted into the excel spreadsheet
x = xlsread(['data',slash,'data_wide.xls']);


xq = [];
xmfactor = x;


%y.xls contains time series for real variables saved in indicators.dta file
%and processed using "Data prep 4.do". All 0's in beginning or end of sample are set to "." 
data.y = xlsread(['data',slash,'y.xls']);
data.year = data.y(1:end-1,2);
data.month = data.y(1:end-1,3);
data.x = x./repmat(data.y(1:end-1,end),1,size(x,2));
data.y(:,1:end-1) = data.y(:,1:end-1)./repmat(data.y(:,end),1,size(data.y,2)-1);
data.y = data.y(1:end-1,4:end);
save(['data',slash,'data_small'])

